home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / os2 / memsz313.zip / SOURCE.ZIP / CONFIG.CPP < prev    next >
Text File  |  1996-02-09  |  21KB  |  473 lines

  1. /***************************************************************** CONFIG.CPP
  2.  *                                                                          *
  3.  *                        Clock Configuration Dialog                        *
  4.  *                                                                          *
  5.  ****************************************************************************/
  6.  
  7. #define INCL_BASE
  8. #define INCL_PM
  9. #define INCL_WINSTDSPIN
  10. #include <os2.h>
  11.  
  12. #include <stdlib.h>
  13. #include <string.h>
  14.  
  15. #include "debug.h"
  16. #include "support.h"
  17.  
  18. #include "memsize.h"
  19. #include "config.h"
  20.  
  21.  
  22. /****************************************************************************
  23.  *                                                                          *
  24.  *                     Definitions & Declarations                           *
  25.  *                                                                          *
  26.  ****************************************************************************/
  27.  
  28.   // Function Prototypes
  29.  
  30. static FNWP InitDlg ;
  31. static FNWP Control ;
  32. static FNWP Command ;
  33. static FNWP OK ;
  34. static FNWP Cancel ;
  35.  
  36. typedef struct {
  37.    char DefaultLabel [80] ;
  38.    char CurrentLabel [80] ;
  39. } LABEL_PARMS, *PLABEL_PARMS ;
  40.  
  41. static FNWP Label_Processor ;
  42.  
  43.  
  44. /****************************************************************************
  45.  *                                                                          *
  46.  *      "Configure" Dialog Processor                                        *
  47.  *                                                                          *
  48.  ****************************************************************************/
  49.  
  50. extern MRESULT EXPENTRY ConfigureProcessor ( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 ) {
  51.  
  52.   /**************************************************************************
  53.    * Dispatch the message according to the method table and return the      *
  54.    *   result.  Any messages not defined above get handled by the system    *
  55.    *   default dialog processor.                                            *
  56.    **************************************************************************/
  57.  
  58.    static METHOD Methods [] = {
  59.       { WM_INITDLG, InitDlg },
  60.       { WM_CONTROL, Control },
  61.       { WM_COMMAND, Command }
  62.    } ;
  63.  
  64.    return ( DispatchMessage ( hwnd, msg, mp1, mp2, Methods, sizeof(Methods)/sizeof(Methods[0]), WinDefDlgProc ) ) ;
  65. }
  66.  
  67. /****************************************************************************
  68.  *                                                                          *
  69.  *      Initialize Dialog                                                   *
  70.  *                                                                          *
  71.  ****************************************************************************/
  72.  
  73. static MRESULT APIENTRY InitDlg ( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 ) {
  74.  
  75.   /**************************************************************************
  76.    * Get initial parameters.                                                *
  77.    **************************************************************************/
  78.  
  79.    PCONFIG_PARMS Parms = PCONFIG_PARMS ( PVOIDFROMMP ( mp2 ) ) ;
  80.  
  81.    WinSetWindowPtr ( hwnd, QWL_USER, Parms ) ;
  82.  
  83.   /**************************************************************************
  84.    * Associate the help instance.                                           *
  85.    **************************************************************************/
  86.  
  87.    WinAssociateHelpInstance ( WinQueryHelpInstance(WinQueryWindow(hwnd,QW_OWNER)), hwnd ) ;
  88.  
  89.   /**************************************************************************
  90.    * Load the list box.                                                     *
  91.    **************************************************************************/
  92.  
  93.    Parms->Ready = FALSE ;
  94.  
  95.    for ( int i=0; i<Parms->ItemCount; i++ ) {
  96.  
  97.       char Label [164] ;
  98.       strcpy ( Label, Parms->CurrentLabels[i] ) ;
  99.       if ( strcmp ( Parms->DefaultLabels[i], Parms->CurrentLabels[i] ) ) {
  100.          strcat ( Label, " (" ) ;
  101.          strcat ( Label, Parms->DefaultLabels[i] ) ;
  102.          strcat ( Label, ")" ) ;
  103.       } /* endif */
  104.  
  105.       WinSendDlgItemMsg ( hwnd, IDD_CONFIG_ITEMS, LM_INSERTITEM,
  106.          MPFROMSHORT(LIT_END), MPFROMP(Label) ) ;
  107.  
  108.       if ( Parms->ItemFlags[i] )
  109.          WinSendDlgItemMsg ( hwnd, IDD_CONFIG_ITEMS, LM_SELECTITEM, MPFROMSHORT(i), MPFROMSHORT(TRUE) ) ;
  110.  
  111.    } /* endfor */
  112.  
  113.   /**************************************************************************
  114.    * Set the radio button and checkbox values.                              *
  115.    **************************************************************************/
  116.  
  117.    WinSendDlgItemMsg ( hwnd, IDD_CONFIG_HIDECONTROLS,
  118.       BM_SETCHECK, MPFROMSHORT(Parms->HideControls), 0 ) ;
  119.  
  120.    WinSendDlgItemMsg ( hwnd, IDD_CONFIG_FLOAT,
  121.       BM_SETCHECK, MPFROMSHORT(Parms->Float), 0 ) ;
  122.  
  123.    WinSendDlgItemMsg ( hwnd, IDD_CONFIG_ANIMATE,
  124.       BM_SETCHECK, MPFROMSHORT(Parms->Animate), 0 ) ;
  125.  
  126.    WinSendDlgItemMsg ( hwnd, IDD_CONFIG_FSNAME,
  127.       BM_SETCHECK, MPFROMSHORT(Parms->ShowFileSystemNames), 0 ) ;
  128.  
  129.    WinSendDlgItemMsg ( hwnd, IDD_CONFIG_DLABEL,
  130.       BM_SETCHECK, MPFROMSHORT(Parms->ShowDiskLabels), 0 ) ;
  131.  
  132.    WinSendDlgItemMsg ( hwnd, IDD_CONFIG_SECONDS,
  133.       BM_SETCHECK, MPFROMSHORT(Parms->ShowSeconds), 0 ) ;
  134.  
  135.    switch ( Parms->ShowK ) {
  136.       case SHOWK_NEVER:
  137.          WinSendDlgItemMsg ( hwnd, IDD_CONFIG_SHOWK_NEVER, BM_SETCHECK, MPFROMSHORT(TRUE), 0 ) ;
  138.          break;
  139.       case SHOWK_ALWAYS:
  140.          WinSendDlgItemMsg ( hwnd, IDD_CONFIG_SHOWK_ALWAYS, BM_SETCHECK, MPFROMSHORT(TRUE), 0 ) ;
  141.          break;
  142.       case SHOWK_ABOVE512:
  143.       default:
  144.          WinSendDlgItemMsg ( hwnd, IDD_CONFIG_SHOWK_ABOVE512, BM_SETCHECK, MPFROMSHORT(TRUE), 0 ) ;
  145.          break;
  146.    } /* endswitch */
  147.  
  148.    switch ( Parms->AnchorCorner ) {
  149.       case CORNER_BL:
  150.       default:
  151.          WinSendDlgItemMsg ( hwnd, IDD_CONFIG_BL, BM_SETCHECK, MPFROMSHORT(TRUE), 0 ) ;
  152.          break;
  153.       case CORNER_BR:
  154.          WinSendDlgItemMsg ( hwnd, IDD_CONFIG_BR, BM_SETCHECK, MPFROMSHORT(TRUE), 0 ) ;
  155.          break;
  156.       case CORNER_TL:
  157.          WinSendDlgItemMsg ( hwnd, IDD_CONFIG_TL, BM_SETCHECK, MPFROMSHORT(TRUE), 0 ) ;
  158.          break;
  159.       case CORNER_TR:
  160.          WinSendDlgItemMsg ( hwnd, IDD_CONFIG_TR, BM_SETCHECK, MPFROMSHORT(TRUE), 0 ) ;
  161.          break;
  162.    } /* endswitch */
  163.  
  164.   /**************************************************************************
  165.    * Set the limits and initial value of the spin-button controls.          *
  166.    **************************************************************************/
  167.  
  168.    WinSendDlgItemMsg ( hwnd, IDD_CONFIG_PRIORITY,
  169.       SPBM_SETLIMITS, (MPARAM)PRTYD_MAXIMUM, (MPARAM)0 ) ;
  170.  
  171.    WinSendDlgItemMsg ( hwnd, IDD_CONFIG_PRIORITY,
  172.       SPBM_SETCURRENTVALUE, (MPARAM)(Parms->MonitorPriority), NULL ) ;
  173.  
  174.    WinSendDlgItemMsg ( hwnd, IDD_CONFIG_TIMER,
  175.       SPBM_SETLIMITS, (MPARAM)300, (MPARAM)10 ) ;
  176.  
  177.    WinSendDlgItemMsg ( hwnd, IDD_CONFIG_TIMER,
  178.       SPBM_SETCURRENTVALUE, (MPARAM)(Parms->TimerInterval/100), NULL ) ;
  179.  
  180.   /**************************************************************************
  181.    * Initialize state.                                                      *
  182.    **************************************************************************/
  183.  
  184.    Parms->Ready = TRUE ;
  185.    Parms->MostRecentSelection = -1 ;
  186.  
  187.   /**************************************************************************
  188.    * Return without error.                                                  *
  189.    **************************************************************************/
  190.  
  191.    return ( 0 ) ;
  192. }
  193.  
  194. /****************************************************************************
  195.  *                                                                          *
  196.  *      Process control messages.                                           *
  197.  *                                                                          *
  198.  ****************************************************************************/
  199.  
  200. static MRESULT APIENTRY Control ( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 ) {
  201.  
  202.   /**************************************************************************
  203.    * Find the instance data.                                                *
  204.    **************************************************************************/
  205.  
  206.    PCONFIG_PARMS Parms = PCONFIG_PARMS ( WinQueryWindowPtr ( hwnd, QWL_USER ) ) ;
  207.  
  208.   /**************************************************************************
  209.    * Decode the message.  Find out what control sent it, and what the       *
  210.    *   control had to say.                                                  *
  211.    **************************************************************************/
  212.  
  213.    SHORT Id = SHORT1FROMMP ( mp1 ) ;
  214.    SHORT Message = SHORT2FROMMP ( mp1 ) ;
  215.  
  216.   /**************************************************************************
  217.    * If the message origin was the List Box, process the message here.      *
  218.    **************************************************************************/
  219.  
  220.    if ( Id == IDD_CONFIG_ITEMS ) {
  221.  
  222.       switch ( Message ) {
  223.  
  224.          case LN_SELECT: {
  225.             if ( NOT Parms->Ready )
  226.                break ;
  227.             SHORT Selection = LIT_FIRST ;
  228.             SHORT Last = -1 ;
  229.             do {
  230.                Selection = short ( SHORT1FROMMR ( WinSendDlgItemMsg ( hwnd,
  231.                   IDD_CONFIG_ITEMS, LM_QUERYSELECTION,
  232.                   MPFROMSHORT(SHORT(Selection)), 0 ) ) ) ;
  233.                if ( Selection != LIT_NONE ) {
  234.                   for ( Last++; Last<Selection; Last++ ) {
  235.                      if ( Parms->ItemFlags[Last] ) {
  236.                         Parms->ItemFlags[Last] = FALSE ;
  237.                         Parms->MostRecentSelection = Last ;
  238.                      } /* endif */
  239.                   } /* endfor */
  240.                   if ( Parms->ItemFlags[Selection] == FALSE ) {
  241.                      Parms->ItemFlags[Selection] = TRUE ;
  242.                      Parms->MostRecentSelection = Selection ;
  243.                   } /* endif */
  244.                } else {
  245.                   for ( Last++; Last<Parms->ItemCount; Last++ ) {
  246.                      if ( Parms->ItemFlags[Last] ) {
  247.                         Parms->ItemFlags[Last] = FALSE ;
  248.                         Parms->MostRecentSelection = Last ;
  249.                      } /* endif */
  250.                   } /* endfor */
  251.                } /* endif */
  252.             } while ( Selection != LIT_NONE ) ;
  253.             break ;
  254.          } /* endcase */
  255.  
  256.          case LN_ENTER: {
  257.             if ( Parms->MostRecentSelection == -1 ) 
  258.                break ;
  259.  
  260.             LABEL_PARMS LabelParms ;
  261.             strcpy ( LabelParms.DefaultLabel, Parms->DefaultLabels[Parms->MostRecentSelection] ) ;
  262.             strcpy ( LabelParms.CurrentLabel, Parms->CurrentLabels[Parms->MostRecentSelection] ) ;
  263.             if ( WinDlgBox ( HWND_DESKTOP, hwnd, Label_Processor, LibraryHandle, IDD_LABEL, &LabelParms ) ) {
  264.                strcpy ( Parms->CurrentLabels[Parms->MostRecentSelection], LabelParms.CurrentLabel ) ;
  265.                char Label [164] ;
  266.                strcpy ( Label, Parms->CurrentLabels[Parms->MostRecentSelection] ) ;
  267.                if ( strcmp ( Parms->DefaultLabels[Parms->MostRecentSelection], Parms->CurrentLabels[Parms->MostRecentSelection] ) ) {
  268.                   strcat ( Label, " (" ) ;
  269.                   strcat ( Label, Parms->DefaultLabels[Parms->MostRecentSelection] ) ;
  270.                   strcat ( Label, ")" ) ;
  271.                } /* endif */
  272.                WinSendDlgItemMsg ( hwnd, IDD_CONFIG_ITEMS, LM_DELETEITEM,
  273.                   MPFROMSHORT(Parms->MostRecentSelection), 0 ) ;
  274.                WinSendDlgItemMsg ( hwnd, IDD_CONFIG_ITEMS, LM_INSERTITEM,
  275.                   MPFROMSHORT(Parms->MostRecentSelection), MPFROMP(Label) ) ;
  276.                WinSendDlgItemMsg ( hwnd, IDD_CONFIG_ITEMS, LM_SELECTITEM,
  277.                   MPFROMSHORT(Parms->MostRecentSelection), MPFROMSHORT(TRUE) ) ;
  278.             } /* endif */
  279.             break ;
  280.          } /* endcase */
  281.  
  282.       } /* endswitch */
  283.  
  284.    } /* endif */
  285.  
  286.   /**************************************************************************
  287.    * Return without error.                                                  *
  288.    **************************************************************************/
  289.  
  290.    return ( 0 ) ;
  291. }
  292.  
  293. /****************************************************************************
  294.  *                                                                          *
  295.  *      Process commands.                                                   *
  296.  *                                                                          *
  297.  ****************************************************************************/
  298.  
  299. static MRESULT APIENTRY Command ( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 ) {
  300.  
  301.   /**************************************************************************
  302.    * Dispatch the message without a default message processor.              *
  303.    **************************************************************************/
  304.  
  305.    static METHOD Methods [] = {
  306.       { DID_OK,     OK     },
  307.       { DID_CANCEL, Cancel },
  308.    } ;
  309.  
  310.    return ( DispatchMessage ( hwnd, SHORT1FROMMP(mp1), mp1, mp2, Methods, sizeof(Methods)/sizeof(Methods[0]), PFNWP(NULL) ) ) ;
  311. }
  312.  
  313. /****************************************************************************
  314.  *                                                                          *
  315.  *      Process the OK button being pressed.                                *
  316.  *                                                                          *
  317.  ****************************************************************************/
  318.  
  319. static MRESULT APIENTRY OK ( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 ) {
  320.  
  321.   /**************************************************************************
  322.    * Find the instance data.                                                *
  323.    **************************************************************************/
  324.  
  325.    PCONFIG_PARMS Parms = PCONFIG_PARMS ( WinQueryWindowPtr ( hwnd, QWL_USER ) ) ;
  326.  
  327.   /**************************************************************************
  328.    * Query the list box items for their selection.                          *
  329.    **************************************************************************/
  330.  
  331.    for ( int i=0; i<Parms->ItemCount; i++ )
  332.       Parms->ItemFlags[i] = FALSE ;
  333.  
  334.    SHORT Selection = LIT_FIRST ;
  335.    do {
  336.  
  337.       Selection = short ( SHORT1FROMMR ( WinSendDlgItemMsg ( hwnd,
  338.          IDD_CONFIG_ITEMS, LM_QUERYSELECTION,
  339.          MPFROMSHORT(SHORT(Selection)), 0 ) ) ) ;
  340.  
  341.       if ( Selection != LIT_NONE ) 
  342.         Parms->ItemFlags[Selection] = TRUE ;
  343.  
  344.    } while ( Selection != LIT_NONE ) ;
  345.  
  346.   /**************************************************************************
  347.    * Query the buttons for their new settings.                              *
  348.    **************************************************************************/
  349.  
  350.    Parms->HideControls = (BOOL) SHORT1FROMMR ( WinSendDlgItemMsg ( hwnd,
  351.       IDD_CONFIG_HIDECONTROLS, BM_QUERYCHECK, 0, 0 ) ) ;
  352.  
  353.    Parms->Float = (BOOL) SHORT1FROMMR ( WinSendDlgItemMsg ( hwnd,
  354.       IDD_CONFIG_FLOAT, BM_QUERYCHECK, 0, 0 ) ) ;
  355.  
  356.    Parms->Animate = (BOOL) SHORT1FROMMR ( WinSendDlgItemMsg ( hwnd,
  357.       IDD_CONFIG_ANIMATE, BM_QUERYCHECK, 0, 0 ) ) ;
  358.  
  359.    Parms->ShowFileSystemNames = (BOOL) SHORT1FROMMR ( WinSendDlgItemMsg ( hwnd,
  360.       IDD_CONFIG_FSNAME, BM_QUERYCHECK, 0, 0 ) ) ;
  361.  
  362.    Parms->ShowDiskLabels = (BOOL) SHORT1FROMMR ( WinSendDlgItemMsg ( hwnd,
  363.       IDD_CONFIG_DLABEL, BM_QUERYCHECK, 0, 0 ) ) ;
  364.  
  365.    Parms->ShowSeconds = (BOOL) SHORT1FROMMR ( WinSendDlgItemMsg ( hwnd,
  366.       IDD_CONFIG_SECONDS, BM_QUERYCHECK, 0, 0 ) ) ;
  367.  
  368.    if ( SHORT1FROMMR ( WinSendDlgItemMsg ( hwnd, IDD_CONFIG_SHOWK_NEVER, BM_QUERYCHECK, 0, 0 ) ) ) {
  369.       Parms->ShowK = SHOWK_NEVER ;
  370.    } else if ( SHORT1FROMMR ( WinSendDlgItemMsg ( hwnd, IDD_CONFIG_SHOWK_ABOVE512, BM_QUERYCHECK, 0, 0 ) ) ) {
  371.       Parms->ShowK = SHOWK_ABOVE512 ;
  372.    } else if ( SHORT1FROMMR ( WinSendDlgItemMsg ( hwnd, IDD_CONFIG_SHOWK_ALWAYS, BM_QUERYCHECK, 0, 0 ) ) ) {
  373.       Parms->ShowK = SHOWK_ALWAYS ;
  374.    } /* endif */
  375.  
  376.    if ( SHORT1FROMMR ( WinSendDlgItemMsg ( hwnd, IDD_CONFIG_BL, BM_QUERYCHECK, 0, 0 ) ) ) {
  377.       Parms->AnchorCorner = CORNER_BL ;
  378.    } else if ( SHORT1FROMMR ( WinSendDlgItemMsg ( hwnd, IDD_CONFIG_BR, BM_QUERYCHECK, 0, 0 ) ) ) {
  379.       Parms->AnchorCorner = CORNER_BR ;
  380.    } else if ( SHORT1FROMMR ( WinSendDlgItemMsg ( hwnd, IDD_CONFIG_TL, BM_QUERYCHECK, 0, 0 ) ) ) {
  381.       Parms->AnchorCorner = CORNER_TL ;
  382.    } else if ( SHORT1FROMMR ( WinSendDlgItemMsg ( hwnd, IDD_CONFIG_TR, BM_QUERYCHECK, 0, 0 ) ) ) {
  383.       Parms->AnchorCorner = CORNER_TR ;
  384.    } /* endif */
  385.  
  386.   /**************************************************************************
  387.    * Query the spinbuttons for their new settings.                          *
  388.    **************************************************************************/
  389.  
  390.    WinSendDlgItemMsg ( hwnd, IDD_CONFIG_PRIORITY, SPBM_QUERYVALUE,
  391.       &Parms->MonitorPriority, MPFROM2SHORT(0,SPBQ_UPDATEIFVALID) ) ;
  392.  
  393.    WinSendDlgItemMsg ( hwnd, IDD_CONFIG_TIMER, SPBM_QUERYVALUE,
  394.       &Parms->TimerInterval, MPFROM2SHORT(0,SPBQ_UPDATEIFVALID) ) ;
  395.  
  396.    Parms->TimerInterval *= 100 ;
  397.  
  398.   /**************************************************************************
  399.    * Dismiss the dialog with a TRUE status.                                 *
  400.    **************************************************************************/
  401.  
  402.    WinDismissDlg ( hwnd, TRUE ) ;
  403.  
  404.    return ( 0 ) ;
  405. }
  406.  
  407. /****************************************************************************
  408.  *                                                                          *
  409.  *      Process the Cancel button being pressed.                            *
  410.  *                                                                          *
  411.  ****************************************************************************/
  412.  
  413. static MRESULT APIENTRY Cancel ( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 ) {
  414.  
  415.   /**************************************************************************
  416.    * Dismiss the dialog with a TRUE status.                                 *
  417.    **************************************************************************/
  418.  
  419.    WinDismissDlg ( hwnd, FALSE ) ;
  420.  
  421.    return ( 0 ) ;
  422. }
  423.  
  424.  
  425. /****************************************************************************
  426.  *                                                                          *
  427.  *      Item Label dialog processor.                                        *
  428.  *                                                                          *
  429.  ****************************************************************************/
  430.  
  431. static MRESULT APIENTRY Label_Processor ( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 ) {
  432.  
  433.    switch ( msg ) {
  434.  
  435.       case WM_INITDLG: {
  436.          PLABEL_PARMS Parms = PLABEL_PARMS ( PVOIDFROMMP ( mp2 ) ) ;
  437.          WinSetWindowPtr ( hwnd, QWL_USER, Parms ) ;
  438.          WinAssociateHelpInstance ( WinQueryHelpInstance(WinQueryWindow(hwnd,QW_OWNER)), hwnd ) ;
  439.          WinSetDlgItemText ( hwnd, IDD_LABEL_DEFLABEL, PSZ(Parms->DefaultLabel) ) ;
  440.          WinSetDlgItemText ( hwnd, IDD_LABEL_NEWLABEL, PSZ(Parms->CurrentLabel) ) ;
  441.          WinSendMsg ( WinWindowFromID(hwnd,IDD_LABEL_NEWLABEL), EM_SETTEXTLIMIT, MPFROM2SHORT(sizeof(Parms->CurrentLabel),0), 0 ) ;
  442.          return ( 0 ) ; }
  443.  
  444.       case WM_COMMAND: {
  445.          PLABEL_PARMS Parms = PLABEL_PARMS ( WinQueryWindowPtr ( hwnd, QWL_USER ) ) ;
  446.          switch ( SHORT1FROMMP(mp1) ) {
  447.             case DID_OK:
  448.                WinQueryDlgItemText ( hwnd, IDD_LABEL_NEWLABEL, sizeof(Parms->CurrentLabel), PSZ(Parms->CurrentLabel) ) ;
  449.                if ( Parms->CurrentLabel[0] == 0 ) {
  450.                   WinAlarm ( HWND_DESKTOP, WA_NOTE ) ;
  451.                   WinSetFocus ( HWND_DESKTOP, WinWindowFromID ( hwnd, IDD_LABEL_NEWLABEL ) ) ;
  452.                   break ;
  453.                } /* endif */
  454.                WinDismissDlg ( hwnd, TRUE ) ;
  455.                break ;
  456.             case DID_CANCEL:
  457.                WinDismissDlg ( hwnd, FALSE ) ;
  458.                break ;
  459.             case IDD_LABEL_DEFAULT:
  460.                strcpy ( Parms->CurrentLabel, Parms->DefaultLabel ) ;
  461.                WinSetDlgItemText ( hwnd, IDD_LABEL_NEWLABEL, PSZ(Parms->CurrentLabel) ) ;
  462.                WinSetFocus ( HWND_DESKTOP, WinWindowFromID ( hwnd, IDD_LABEL_NEWLABEL ) ) ;
  463.                break ;
  464.          } /* endswitch */
  465.          return ( 0 ) ; }
  466.  
  467.    } /* endswitch */
  468.  
  469.    return ( WinDefDlgProc ( hwnd, msg, mp1, mp2 ) ) ;
  470. }
  471.  
  472.  
  473.